import request from "@/utils/request";
import qs from "qs";
//数据分类列表
export function typeList(query) {
  return request({
    url: "/datascan/b/redissensitivedata/queryDataTypeList",
    method: "get",
    params: query,
  });
}
//敏感级别
export function level(query) {
  return request({
    url: "/system/b/redissensitivedata/queryDataLevelList ",
    method: "get",
    params: query,
  });
}
// 查询的基本信息列表
export function queryTableListByPage(query) {
  return request({
    url: "/datascan/b/scanresulttable/queryTablePageList",
    method: "get",
    params: query,
  });
}

// 查询的基本信息详细
export function getTable(id) {
  return request({
    url: "/datascan/table/" + id,
    method: "get",
  });
}

// 新增的基本信息
export function addTable(data) {
  return request({
    url: "/datascan/table",
    method: "post",
    data: data,
  });
}

// 编辑的基本信息
export function updateTable(data) {
  return request({
    url: "/datascan/table",
    method: "put",
    data: data,
  });
}

// 删除的基本信息
export function delTable(id) {
  return request({
    url: "/datascan/table/" + id,
    method: "delete",
  });
}

// 获取标签列表
export function queryTagList(data) {
  return request({
    url: "/datascan/b/redissensitivedata/queryTagList",
    method: "get",
    params: data,
  });
}
//重要数据下拉
export function queryAllTagList(data) {
  return request({
    url: "/datascan/b/redissensitivedata/queryAllTagList",
    method: "get",
    params: data,
  });
}
// 根据ID获取标签
export function queryTagListById(data) {
  return request({
    url: "/datascan/b/tabletags/queryList",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    },
    data: qs.stringify(data),
  });
}

// 根据ID获取标签
export function addOrUpdate(data) {
  return request({
    url: "/datascan/b/tabletags/addOrUpdate",
    method: "post",
    data,
  });
}

// 根据ID获取标签
export function queryDataTypeTreeList(params) {
  return request({
    url: "/datascan/b/redissensitivedata/queryDataTypeTreeList",
    method: "get",
    params,
  });
}
// 根据字段获取对应数据
export function selectDiserRuleDetail(query) {
  return request({
    url: "/datascan/b/scanresulttable/selectDiserRuleDetail",
    method: "get",
    params: query,
  });
}

// 绑定重要数据
export function updateImpData(data) {
  return request({
    url: "/datascan/b/scanresulttable/updateImpData",
    method: "post",
    data,
  });
}

// 绑定核心数据
export function updateCoreData(data) {
  return request({
    url: "/datascan/b/scanresulttable/updateCoreData",
    method: "post",
    data,
  });
}

// 绑定识别规则
export function updateDiscerRule(data) {
  return request({
    url: "/datascan/b/scanresulttable/updateDiscerRule",
    method: "post",
    data,
  });
}

// 绑定数据分类
export function updateDataType(data) {
  return request({
    url: "/datascan/b/scanresulttable/updateDataType",
    method: "post",
    data,
  });
}
